home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / modcmd16.zip / MODCMD.DOC < prev    next >
Text File  |  1989-07-14  |  6KB  |  148 lines

  1.  
  2.  
  3.  
  4.                     MODCMD Version 1.6 by Michael Smith
  5.                        Documentation by Wayne Morton
  6.  
  7.  
  8.                               INTRODUCTION
  9.                               ------------
  10.  
  11.    This program was written to answer a need to send commands to my modem from
  12. batch files. Sounds simple and easy to do, and there's even a program called
  13. DOSMODEM made to do just that. The problem comes with my computer, because it's
  14. an older model and it's very picky about how you access the COM port and how
  15. you address the modem itself. My modem (a Hayes) igornes commands sent to it
  16. by DOSMODEM, and from the command line (such as "ECHO ATDT5551234 >COM1:")
  17. MODCMD.EXE answers my needs. It's very selective in how it addresses the COM
  18. port and should work on all computers and modems.
  19.  
  20.  
  21.  
  22.                             HOW TO USE MODCMD
  23.                             -----------------
  24.  
  25.      The correct usage is:
  26.  
  27.               MODCMD [Port] [String] /[Baud]
  28.  
  29.       [Port] = Either COM1: or COM2: (does not have to be capitilized)
  30.     [String] = Any modem string or command
  31.       [Baud] = The baud rate you want to set the modem to; be sure to
  32.                place the "/" before the rate.
  33.  
  34.    For example:  MODCMD COM1: ATZ /1200  would set COM1:'s baud rate to 1200,
  35. then send the "ATZ" reset string to the modem.
  36.  
  37.    The baud rate switch is optional; if you do not specify the baud rate it
  38. will default to 1200. It's important not to include spaces in any of the modem
  39. strings or MODCMD could interpret part of the string to be a baud set command:
  40.  
  41.            WRONG:  MODCMD COM2: ATDT 9,5552368 !,#71234
  42.  
  43.            RIGHT:  MODCMD COM2: ATDT9,5552368!,#71234;
  44.  
  45. This instructs the modem to do the following:
  46.  
  47.                ATD       Dial command
  48.                T         Use touch-tone dialing
  49.                9         Access a number outside the local PBX
  50.                ,         Pause before dialing
  51.                5552368   Dial this phone number
  52.                !         Perform a hookflash to alert PBX
  53.                ,         Pause before dialing extension
  54.                #7        Issue PBX transfer code
  55.                1234      Dial extension 1234
  56.                ;         Return modem to command mode after
  57.                    connecting.
  58.  
  59.    If you are not familiar with the Hayes modem commands you should consult the
  60. instruction book that came with your modem.
  61.  
  62.    To change the baud rate of a serial port without sending any command, use
  63. MODCMD COM1: % /[Baudrate]. The "%" takes the place of a normal hayes command,
  64. therefore it just resets the I/O port, sets the new baud rate, and "wakes up"
  65. the modem, without executing any command (actually, any non-hayes blurb will
  66. do...instead of "%" you could have "do-nothing").
  67.  
  68.    For a summary of the correct usage just type MODCMD without any parameters
  69. following it and it will give you a small help screen.
  70.  
  71.  
  72.                                USES FOR MODCMD
  73.                                ---------------
  74.  
  75.      MODCMD makes a nice "desktop" dialer when written into a simple batch file
  76. like this sample that we'll call DIAL.BAT:
  77.  
  78. ECHO OFF
  79. IF X%1==X GOTO :BAD
  80. GOTO %1
  81. :NICK
  82. MODCMD COM1: ATDT5551234
  83. GOTO :CONNECT
  84. :MIKE
  85. MODCMD COM1: ATDT55556789
  86. GOTO :CONNECT
  87. :TOM
  88. MODCMD COM1: ATDT5550123
  89. GOTO :CONNECT
  90. :#
  91. MODCMD COM1: ATDT%2
  92. GOTO :CONNECT
  93. :CONNECT
  94. ECHO The modem has dialed %1 %2 pick up the phone and
  95. PAUSE
  96. MODCMD COM1: ATH0
  97. GOTO :END
  98. :BAD
  99. ECHO  YOU MUST ENTER THE NAME OR NUMBER THAT YOU WANT TO DIAL
  100. :END
  101.  
  102.      This batch file will allow you to dial by names or numbers. To use it you
  103. would simply type DIAL and the name of the person you want to call. For example
  104. DIAL TOM would cause the batch file to go to the label :TOM and MODCMD would
  105. dial the number 5550123, pause for you to pick up the phone, then hang up. If
  106. you want to dial a number that's not written into the batch file you would just
  107. enter: DIAL # 5551234.  The modem will then dial the number and wait the same
  108. way it does when you dial names.
  109.  
  110.    If you don't understand the way the batch file works, read the section in
  111. your DOS manual on writing batch files.
  112.  
  113.    When writing batch files that will issue two or more MODCMD commands in a
  114. row, you will need to issue a WAIT command between them; otherwise the second
  115. command will cancel out the first before the modem has time to respond. For
  116. this reason a copy of the program WAIT.COM has been included with MODCMD. To
  117. use WAIT just use the syntax: WAIT [Number of seconds to wait]
  118.  
  119. For example:
  120.  
  121. MODCMD COM1: ATDT5551234
  122. WAIT 8
  123. MODCMD COM1: ATH0
  124. WAIT 3
  125. MODCMD COM1: ATDT5551234
  126. WAIT 8
  127.  
  128.    Without the WAIT commands the modem would hang-up before it completes
  129. dialing the number. With the WAIT it will dial 5551234 then hang up then dial
  130. 5551234, etc.
  131.  
  132.  
  133.                                 EPILOGUE
  134.                                 --------
  135.  
  136.    Michael wrote MODCMD in C, so it's "pseudo" intelligence would be easier to
  137. impliment (hence the claim "it will work where others won't"). If it absolutely
  138. refuses to work on your setup, drop him a line describing your system setup in
  139. detail, and the exact nature of the problem. He can be reached on THE PRAEDO
  140. BBS at (609) 953-0769; send e-mail to MICHAEL SMITH. You can also leave me a
  141. message on GEnie at the e-mail address of W.MORTON.
  142.  
  143.    MODCMD is COPYRIGHT 1989 by UNICUS ENTERPRISES and is offered to you FREE OF
  144. CHARGE with the condition that the program may not be altered and must include
  145. this documentation and notice in the package.  Please feel free to copy this
  146. program and share it with your friends or post it on bulletin boards.
  147.  
  148.  DOSMODEM, and from the command